package com.ruoyi.project.charging.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;

/**
 * 岸电MQTT消息原始数据对象 t_charging_mqtt_msg
 * 
 * @author Yaoxuan Mo
 * @date 2025-07-28
 */
public class TChargingMqttMsg extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** MQTT消息ID */
    private String msgid;

    /** MQTT主题 */
    @Excel(name = "MQTT主题")
    private String topic;

    /** MQTT消息的QoS，与消息稳定传输的机制有关 */
    @Excel(name = "MQTT消息的QoS，与消息稳定传输的机制有关")
    private Long qos;

    /** MQTT消息体，由下面三个子字段组合而成 */
    @TableField(exist = false)
    private String payload;

    /** MQTT消息体（子字段1） */
    @Excel(name = "MQTT消息体（子字段1）")
    private String payload1;

    /** MQTT消息体（子字段2） */
    @Excel(name = "MQTT消息体（子字段2）")
    private String payload2;

    /** MQTT消息体（子字段3） */
    @Excel(name = "MQTT消息体（子字段3）")
    private String payload3;

    /** 数据插入时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "数据插入时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date insTim;

    /** 消息来源Client ID */
    @Excel(name = "消息来源Client ID")
    private String clientId;

    /** 消息来源用户名 */
    @Excel(name = "消息来源用户名")
    private String username;

    /** 客户端的IPAddress */
    @Excel(name = "客户端的IPAddress")
    private String peerhost;

    /** MQTT消息的Flags */
    @Excel(name = "MQTT消息的Flags")
    private String flags;

    /** 事件触发所在节点 */
    @Excel(name = "事件触发所在节点")
    private String node;

    /** 具体事件 */
    @Excel(name = "具体事件")
    private String event;

    /** 消息是否已被转换。0表示未转换，1表示已转换且转换成功，2表示已转换但转换失败。 */
    @Excel(name = "消息是否已被转换。0表示未转换，1表示已转换且转换成功，2表示已转换但转换失败。")
    private String convertFlag;

    /** 消息转换失败原因 */
    @Excel(name = "消息转换失败原因")
    private String failReason;

    public void setMsgid(String msgid) 
    {
        this.msgid = msgid;
    }

    public String getMsgid() 
    {
        return msgid;
    }
    public void setTopic(String topic) 
    {
        this.topic = topic;
    }

    public String getTopic() 
    {
        return topic;
    }
    public void setQos(Long qos) 
    {
        this.qos = qos;
    }

    public Long getQos() 
    {
        return qos;
    }

    public String getPayload() {return payload;}

    public void setPayload(String payload) {this.payload = payload;}

    public void setPayload1(String payload1) 
    {
        this.payload1 = payload1;
    }

    public String getPayload1() 
    {
        return payload1;
    }
    public void setPayload2(String payload2) 
    {
        this.payload2 = payload2;
    }

    public String getPayload2() 
    {
        return payload2;
    }
    public void setPayload3(String payload3) 
    {
        this.payload3 = payload3;
    }

    public String getPayload3() 
    {
        return payload3;
    }
    public void setInsTim(Date insTim) 
    {
        this.insTim = insTim;
    }

    public Date getInsTim() 
    {
        return insTim;
    }
    public void setClientId(String clientId) 
    {
        this.clientId = clientId;
    }

    public String getClientId() 
    {
        return clientId;
    }
    public void setUsername(String username) 
    {
        this.username = username;
    }

    public String getUsername() 
    {
        return username;
    }
    public void setPeerhost(String peerhost) 
    {
        this.peerhost = peerhost;
    }

    public String getPeerhost() 
    {
        return peerhost;
    }
    public void setFlags(String flags) 
    {
        this.flags = flags;
    }

    public String getFlags() 
    {
        return flags;
    }
    public void setNode(String node) 
    {
        this.node = node;
    }

    public String getNode() 
    {
        return node;
    }
    public void setEvent(String event) 
    {
        this.event = event;
    }

    public String getEvent() 
    {
        return event;
    }
    public void setConvertFlag(String convertFlag) 
    {
        this.convertFlag = convertFlag;
    }

    public String getConvertFlag() 
    {
        return convertFlag;
    }
    public void setFailReason(String failReason) 
    {
        this.failReason = failReason;
    }

    public String getFailReason() 
    {
        return failReason;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("msgid", getMsgid())
            .append("topic", getTopic())
            .append("qos", getQos())
            .append("payload", getPayload())
            .append("payload1", getPayload1())
            .append("payload2", getPayload2())
            .append("payload3", getPayload3())
            .append("insTim", getInsTim())
            .append("clientId", getClientId())
            .append("username", getUsername())
            .append("peerhost", getPeerhost())
            .append("flags", getFlags())
            .append("node", getNode())
            .append("event", getEvent())
            .append("convertFlag", getConvertFlag())
            .append("failReason", getFailReason())
            .toString();
    }
}
